﻿using KongMing.ORM.FreeSqlDemo.Models;
using Microsoft.Data.SqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Common;

namespace KongMing.ORM.FreeSqlDemo
{
    public class DaMengAdoDemo
    {
        public static void Go()
        {
            var fsql = FreeSqlHelper.GetFreeSql(FreeSql.DataType.Dameng, "server=localhost:5236;uid=KONGMING;Pwd=admin666666;");
            var users = fsql.Select<SysUserInfo>().ToList();
            //string sql1 = "insert into KONGMING.\"SysUserInfo\" values (2,'bbb');insert into KONGMING.\"SysUserInfo\" values(3, 'ccc'); ";
            //string sql2 = " CREATE TABLE \"tb_sys_config\"(\"name\" nvarchar(450) NOT NULL, --配置key \"value\" TEXT DEFAULT '' NOT NULL, --配置value CONSTRAINT \"PK_tb_sys_config\" PRIMARY KEY(\"name\")); ";
            string sql3 = "insert into \"SysUserInfo\" values(:id,:name); ";
            int i = fsql.Ado.ExecuteNonQuery(sql3, new { id = 1, name = "aaa" });
            //fsql.Ado.ExecuteNonQuery(sql2);
        }
    }
}
